package org.ccf.certified.bean.pagination;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author LiuFang
 * @date 2022/1/12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PageRequest {
    /**
     * 当前页面
     */
    private Long current = 1L;
    /**
     * 每页条数
     */
    private Long pageSize = 20L;

    public PageRequest() {
    }

    public PageRequest(Long current, Long pageSize) {
        this.current = current;
        this.pageSize = pageSize;
    }

    public IPage convertToPage(){
        return new Page(current, pageSize);
    }
}
